<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function sum(a, b){

            // 函数会在最后隐式添加结束的return

            console.log('a');
            return; // 终止函数,并返回undefined
            console.log('b');
        }

        var a = sum();

        function res() {
            return 123;  //返回值，并且终止函数
        }

        var num = res();
    </script>
</body>
</html>